package com.huaxin.common.Entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by Administrator on 2016/9/6.
 * {"arrangeTaskCode":"1479195087524","createDate":1479139200000,
 * "des":"12号的大暴雨造成大片区域内的站点指标故障","id":3,"orgName":"城市排水集团",
 * "planFinishDate":1480003200000,"planStartDate":1479139200000,"planVehicle":"",
 * "realFinishDate":1480003200000,"realStartDate":1479139200000,"realVehicle":"鄂A88888",
 * "checkState":0,"title":"暴雨事故","workTaskCount":2,"workTaskIds":[10,11],
 * "workers":["张阳","Jobs","企业管理员"]}
 */
public class ArrangeWorkTask implements Parcelable{


    int id;
    String arrangeTaskCode; //任务流水号
    int state; //任务状态
    String title; //任务标题
    String des; //任务描述
    long createDate; //创建时间
    long planStartDate; //计划开始时间
    long planFinishDate; //计划完成时间
    long realStartDate; //计划开始时间
    long realFinishDate; //计划完成时间
    String orgName; //组织名
    String planVehicle; // 计划出车
    String realVehicle; //实际出车
    int workTaskCount; //任务数
    String[] workers; //任务负责人
    int[] workTaskIds;//子任务单id
    int taskType;//工单类型 0 巡检单 1 维修单
    float progress;
    int isSuspended;//0表示派工单没暂停，1表示派工单暂停

    public void setIsSuspended(int isSuspended) {
        this.isSuspended = isSuspended;
    }

    public int getIsSuspended() {
        return isSuspended;
    }

    protected ArrangeWorkTask(Parcel in) {
        id = in.readInt();
        arrangeTaskCode = in.readString();
        state = in.readInt();
        title = in.readString();
        des = in.readString();
        createDate = in.readLong();
        planStartDate = in.readLong();
        planFinishDate = in.readLong();
        realStartDate = in.readLong();
        realFinishDate = in.readLong();
        orgName = in.readString();
        planVehicle = in.readString();
        realVehicle = in.readString();
        workTaskCount = in.readInt();
        workers = in.createStringArray();
        workTaskIds = in.createIntArray();
        taskType = in.readInt();
        progress = in.readFloat();
        isSuspended=in.readInt();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(arrangeTaskCode);
        dest.writeInt(state);
        dest.writeString(title);
        dest.writeString(des);
        dest.writeLong(createDate);
        dest.writeLong(planStartDate);
        dest.writeLong(planFinishDate);
        dest.writeLong(realStartDate);
        dest.writeLong(realFinishDate);
        dest.writeString(orgName);
        dest.writeString(planVehicle);
        dest.writeString(realVehicle);
        dest.writeInt(workTaskCount);
        dest.writeStringArray(workers);
        dest.writeIntArray(workTaskIds);
        dest.writeInt(taskType);
        dest.writeFloat(progress);
        dest.writeInt(isSuspended);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<ArrangeWorkTask> CREATOR = new Creator<ArrangeWorkTask>() {
        @Override
        public ArrangeWorkTask createFromParcel(Parcel in) {
            return new ArrangeWorkTask(in);
        }

        @Override
        public ArrangeWorkTask[] newArray(int size) {
            return new ArrangeWorkTask[size];
        }
    };

    public int getId() {
        return id;
    }

    public String getArrangeTaskCode() {
        return arrangeTaskCode;
    }

    public int getState() {
        return state;
    }

    public String getTitle() {
        return title;
    }

    public String getDes() {
        return des;
    }

    public long getCreateDate() {
        return createDate;
    }

    public long getPlanStartDate() {
        return planStartDate;
    }

    public long getPlanFinishDate() {
        return planFinishDate;
    }

    public long getRealStartDate() {
        return realStartDate;
    }

    public long getRealFinishDate() {
        return realFinishDate;
    }

    public String getOrgName() {
        return orgName;
    }

    public String getPlanVehicle() {
        return planVehicle;
    }

    public String getRealVehicle() {
        return realVehicle;
    }

    public int getWorkTaskCount() {
        return workTaskCount;
    }

    public String[] getWorkers() {
        return workers;
    }

    public int[] getWorkTaskIds() {
        return workTaskIds;
    }

    public int getTaskType() {
        return taskType;
    }

    public float getProgress() {
        return progress;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setArrangeTaskCode(String arrangeTaskCode) {
        this.arrangeTaskCode = arrangeTaskCode;
    }

    public void setState(int state) {
        this.state = state;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setDes(String des) {
        this.des = des;
    }

    public void setCreateDate(long createDate) {
        this.createDate = createDate;
    }

    public void setPlanStartDate(long planStartDate) {
        this.planStartDate = planStartDate;
    }

    public void setPlanFinishDate(long planFinishDate) {
        this.planFinishDate = planFinishDate;
    }

    public void setRealStartDate(long realStartDate) {
        this.realStartDate = realStartDate;
    }

    public void setRealFinishDate(long realFinishDate) {
        this.realFinishDate = realFinishDate;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public void setPlanVehicle(String planVehicle) {
        this.planVehicle = planVehicle;
    }

    public void setRealVehicle(String realVehicle) {
        this.realVehicle = realVehicle;
    }

    public void setWorkTaskCount(int workTaskCount) {
        this.workTaskCount = workTaskCount;
    }

    public void setWorkers(String[] workers) {
        this.workers = workers;
    }

    public void setWorkTaskIds(int[] workTaskIds) {
        this.workTaskIds = workTaskIds;
    }

    public void setTaskType(int taskType) {
        this.taskType = taskType;
    }

    public void setProgress(float progress) {
        this.progress = progress;
    }
}
